Release 10.1A: OpenEdge Development:
ADM and SmartObjects
RUN statement
Many aspects of SmartObject behavior are invoked by running internal procedures and invoking functions. Much of this behavior is implemented in super procedures that support the SmartObjects. The behavior in super procedures can be localized, and the Progress interpreter will locate and execute the correct behavior. This is possible because super procedures are initialized and added to each SmartObject as each SmartObject starts up.
For example, an application can use the addLink procedure to add a link from one SmartObject to another during execution:
In this code,
hSourceProcis theHANDLEof the source procedure andhTargetProcis theHANDLEof the target procedure.The
RUNstatement foraddLinkis written as ifaddLinkwere an internal procedure within the calling procedure. In fact, it is contained in the super proceduresmart.p. The super procedure mechanism makes the contents ofsmart.pavailable to every SmartObject. Standard behavior of this kind includes the following procedures (any many others):Similarly, the contents of other SmartObject super procedures are available to SmartObjects that require their support. For example, all visible objects use the super procedure
visual.pand all SmartObjects that can contain other SmartObjects usecontainr.p. (See the AppBuilder online help for a detailed list of super procedures and their contents.) Using this architecture locates the majority of SmartObject behavior in a set of independently built procedures that can serve all SmartObjects that are running in a Progress session. This helps to organize behavior into reusable classes and keeps the size of individual SmartObjects to a minimum.Just as a SmartObject can
RUNprocedures implemented in its super procedures, a SmartObject can invoke behavior in another SmartObject simply by knowing its procedure handle and running internal procedures or functions in that SmartObject. For example, one SmartObject can destroy another by executing the following statement:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |